home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / content / nsIRadioGroupContainer.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  135 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37. #ifndef nsIRadioGroupContainer_h___
  38. #define nsIRadioGroupContainer_h___
  39.  
  40. #include "nsISupports.h"
  41.  
  42. class nsIDOMHTMLInputElement;
  43. class nsString;
  44. class nsIRadioVisitor;
  45. class nsIFormControl;
  46.  
  47. #define NS_IRADIOGROUPCONTAINER_IID   \
  48. { 0x06de7839, 0xd0db, 0x47d3, \
  49.   { 0x82, 0x90, 0x3c, 0xb8, 0x62, 0x2e, 0xd9, 0x66 } }
  50.  
  51. /**
  52.  * A container that has multiple radio groups in it, defined by name.
  53.  */
  54. class nsIRadioGroupContainer : public nsISupports
  55. {
  56. public:
  57.  
  58.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IRADIOGROUPCONTAINER_IID)
  59.  
  60.   /**
  61.    * Walk through the radio group, visiting each note with avisitor->Visit()
  62.    * @param aName the group name
  63.    * @param aVisitor the visitor to visit with
  64.    */
  65.   NS_IMETHOD WalkRadioGroup(const nsAString& aName,
  66.                             nsIRadioVisitor* aVisitor) = 0;
  67.  
  68.   /**
  69.    * Set the current radio button in a group
  70.    * @param aName the group name
  71.    * @param aRadio the currently selected radio button
  72.    */
  73.   NS_IMETHOD SetCurrentRadioButton(const nsAString& aName,
  74.                                    nsIDOMHTMLInputElement* aRadio) = 0;
  75.  
  76.   /**
  77.    * Get the current radio button in a group
  78.    * @param aName the group name
  79.    * @param aRadio the currently selected radio button [OUT]
  80.    */
  81.   NS_IMETHOD GetCurrentRadioButton(const nsAString& aName,
  82.                                    nsIDOMHTMLInputElement** aRadio) = 0;
  83.  
  84.   /**
  85.    * Set the next/prev radio button in a group
  86.    * @param aName the group name
  87.    * @param aPrevious, true gets previous radio button, false gets next
  88.    * @param aFocusedRadio the currently focused radio button
  89.    * @param aRadio the currently selected radio button [OUT]
  90.    */
  91.   NS_IMETHOD GetNextRadioButton(const nsAString& aName,
  92.                                 const PRBool aPrevious,
  93.                                 nsIDOMHTMLInputElement*  aFocusedRadio,
  94.                                 nsIDOMHTMLInputElement** aRadio) = 0;
  95.  
  96.   /**
  97.    * Add radio button to radio group
  98.    *
  99.    * Note that forms do not do anything for this method since they already
  100.    * store radio groups on their own.
  101.    *
  102.    * @param aName radio group's name
  103.    * @param aRadio radio button's pointer
  104.    */
  105.   NS_IMETHOD AddToRadioGroup(const nsAString& aName,
  106.                              nsIFormControl* aRadio) = 0;
  107.  
  108.   /**
  109.    * Remove radio button from radio group
  110.    *
  111.    * Note that forms do not do anything for this method since they already
  112.    * store radio groups on their own.
  113.    *
  114.    * @param aName radio group's name
  115.    * @param aRadio radio button's pointer
  116.    */
  117.   NS_IMETHOD RemoveFromRadioGroup(const nsAString& aName,
  118.                                   nsIFormControl* aRadio) = 0;
  119.  
  120.   /**
  121.    * Get the radio group position and the number of radio buttons in the group.
  122.    * that the radio button is in. If the radio button not grouped with any other
  123.    * radio buttons this method will treat it as being in a group of one.
  124.    * @param aRadio radio button's pointer
  125.    * @param aPositionIndex out indicates 0-indexed position in the radio group,
  126.    *                           or just 0 if a group cannot be found
  127.    * @param aItemsInGroup the number of radio buttons in the group
  128.    */
  129.   NS_IMETHOD GetPositionInGroup(nsIDOMHTMLInputElement *aRadio,
  130.                                 PRInt32 *aPositionIndex,
  131.                                 PRInt32 *aItemsInGroup) = 0;
  132. };
  133.  
  134. #endif /* nsIRadioGroupContainer_h__ */
  135.